package com.itheima.dao.impl;

import com.itheima.dao.DepDao;
import com.itheima.domain.Dep;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate5.HibernateTemplate;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Mr.King on 2017/3/4.
 */
@Service(value = "depDao")
public class DepDaoImpl implements DepDao {

    @Autowired
    private HibernateTemplate template;

    @Override
    public List<Dep> getList() {

        List<Dep> list = (List<Dep>) template.find("from com.itheima.domain.Dep");
        return list;
    }
}
